﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DualityEngine.Data;

namespace DualityEngine.Business
{
    public class PlayerManager
    {
        private static PlayerManager instance;
        
        public string PlayerName { get; private set; }
        public int TotalKills { get; private set; }
        public int TotalDeaths { get; private set; }

        public int ServerKills { get; private set; }
        public int ServerDeaths { get; private set; }
        public int ExperiencePoints { get; private set; }

        public static PlayerManager Instance
        {
            get
            {
                if (instance == null)
                    instance = new PlayerManager();
                return instance;
            }
        }

        private PlayerManager()
        {
        }

        public bool ValidateUser(string username, string password)
        {
            if (GlobalServerConnector.ValidateUser(username, password))
            {
                this.PlayerName = username;
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
